<template>
  <div id="basicLayout" class="theme-transition">
    <a-layout style="min-height: 100vh">
      <a-layout-header class="header">
        <global-header-x></global-header-x>
      </a-layout-header>
      <a-layout>
        <GlobalSider class="sider"></GlobalSider>
        <a-layout-content class="content">
          <router-view></router-view>
        </a-layout-content>
      </a-layout>
      <a-layout-footer class="footer">
        <a href="https://ktkl123.github.io/burgercool/" target="_blank">卡塔酷栗zzz</a>
      </a-layout-footer>
    </a-layout>
  </div>
</template>

<script setup lang="ts">
import GlobalSider from '@/components/GlobalSider.vue'
import GlobalHeaderX from '@/components/GlobalHeaderX.vue'
</script>

<style scoped>
#basicLayout {
  background-color: var(--primary-bg-color);
}

#basicLayout .header {
  background: var(--primary-bg-color);
  color: var(--text-primary-color);
  margin-bottom: 1px;
  padding-inline: 20px;
  box-shadow: 0 1px 4px var(--border-color);
  z-index: 10;
  position: relative;
}

#basicLayout .sider {
  background: var(--primary-bg-color);
  border-right: 0.5px solid var(--border-color);
  padding-top: 20px;
}

#basicLayout :deep(.ant-menu-root) {
  border-bottom: none !important;
  border-inline-end: none !important;
}

#basicLayout .content {
  padding: 28px;
  background: linear-gradient(to right, var(--secondary-bg-color), var(--primary-bg-color));
  margin-bottom: 28px;
  min-height: 280px;
}

#basicLayout .footer {
  background: var(--secondary-bg-color);
  color: var(--text-primary-color);
  font-size: 16px;
  padding: 16px;
  position: fixed;
  align-content: center;
  text-align: center;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border-color);
}

/* Ant Design 组件样式重写 */
:deep(.ant-layout) {
  background-color: var(--primary-bg-color);
}

:deep(.ant-layout-sider) {
  background-color: var(--primary-bg-color) !important;
}

:deep(.ant-layout-header) {
  background-color: var(--primary-bg-color) !important;
}

:deep(.ant-layout-content) {
  background-color: var(--secondary-bg-color) !important;
}

:deep(.ant-layout-footer) {
  background-color: var(--secondary-bg-color) !important;
}

:deep(.ant-btn) {
  background-color: var(--primary-bg-color);
  color: var(--text-primary-color);
  border-color: var(--border-color);
}

:deep(.ant-btn-primary) {
  background-color: var(--primary-color);
  color: #ffffff;
}

:deep(.ant-btn-primary:hover) {
  background-color: var(--primary-color);
  opacity: 0.85;
}

:deep(.ant-menu-item-selected) {
  background-color: var(--selected-bg-color) !important;
  color: var(--selected-text-color) !important;
}

:deep(.ant-menu-item-selected a) {
  color: var(--selected-text-color) !important;
}

:deep(.ant-menu-item-selected .anticon) {
  color: var(--selected-text-color) !important;
}
</style>
